package com.itheima.service.Impl;

import com.itheima.domain.Trip;
import com.itheima.mapper.TripMapper;
import com.itheima.service.TripService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ChaunceyZhang
 */
@Service("TripMapper")
public class TripServiceImpl implements TripService {

    @Autowired
    private TripMapper tripMapper;

    @Override
    public List<Trip> findAll() {
        List<Trip> tripMapperAll = tripMapper.findAll();
        return tripMapperAll;
    }

    @Override
    public void save(Trip trip) {
        tripMapper.save(trip);
    }

    @Override
    public Integer delete(Integer id) {
        Integer delete = tripMapper.delete(id);
        return delete;
    }

    @Override
    public List<Trip> findById(Integer id) {
        List<Trip> accountMapperById = tripMapper.findById(id);
        return accountMapperById;
    }

    @Override
    public void update(Trip trip) {
        tripMapper.update(trip);
    }
}
